iT邦幫忙

2022 iThome 鐵人賽

DAY 12
0
Security

HONEYPOT×TRICK 100%不純保證系列 第 12

Honeypot #7 慘敗的 honeyd 1.5c 安裝過程

  • 分享至 

  • xImage
  •  

老兵還是退休奉著就好...


https://ithelp.ithome.com.tw/upload/images/20220927/20103688kM89vWjOk9.png

直接說結論,要在新的作業系統裝快20年前的軟體是失敗了。與其一直降級套件,不如找舊的作業系統來安裝,成功的機率還大一點。

以下失敗就當記錄一下,免的有人再重蹈覆轍! 本篇是 honey 1.5c 的失敗記錄,下一篇是 1.6d 的失敗記錄,都可以跳過!

honeyd 安裝分兩個部份,一是前置作業,二是本體。
p.s. 前置軟體在新作業系統都還能安裝,問題在於與 honeyd 不相容的問題。

apt 安裝失敗在預期中

[tsec@dependentmini:~]$ sudo apt-get install honeyd
[sudo] password for tsec:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package honeyd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'honeyd' has no installation candidate

接著以下是參考官網手動安裝的過程。

前置軟體:

安裝 libpcap

參考 https://www.linuxquestions.org/questions/linux-software-2/install-libpcap-question-in-debian-235672/

安裝 libpcap 失敗

[tsec@dependentmini:~/honeyd-1.5c]$ sudo apt-get install  libpcap-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libdbus-1-dev libpcap0.8-dev pkg-config
The following NEW packages will be installed:
  libdbus-1-dev libpcap-dev libpcap0.8-dev pkg-config
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 633 kB of archives.
After this operation, 2,135 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian bullseye/main amd64 pkg-config amd64 0.29.2-1 [65.1 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 libdbus-1-dev amd64 1.12.20-2 [256 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 libpcap0.8-dev amd64 1.10.0-2 [281 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 libpcap-dev amd64 1.10.0-2 [31.1 kB]
Fetched 633 kB in 4s (174 kB/s)
Selecting previously unselected package pkg-config.
(Reading database ... 56338 files and directories currently installed.)
Preparing to unpack .../pkg-config_0.29.2-1_amd64.deb ...
Unpacking pkg-config (0.29.2-1) ...
Selecting previously unselected package libdbus-1-dev:amd64.
Preparing to unpack .../libdbus-1-dev_1.12.20-2_amd64.deb ...
Unpacking libdbus-1-dev:amd64 (1.12.20-2) ...
Selecting previously unselected package libpcap0.8-dev:amd64.
Preparing to unpack .../libpcap0.8-dev_1.10.0-2_amd64.deb ...
Unpacking libpcap0.8-dev:amd64 (1.10.0-2) ...
Selecting previously unselected package libpcap-dev:amd64.
Preparing to unpack .../libpcap-dev_1.10.0-2_amd64.deb ...
Unpacking libpcap-dev:amd64 (1.10.0-2) ...
Setting up grub-pc (2.06-3~deb11u2) ...
You must correct your GRUB install devices before proceeding:

  DEBIAN_FRONTEND=dialog dpkg --configure grub-pc
  dpkg --configure -a
dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error exit status 1
Setting up pkg-config (0.29.2-1) ...
Setting up libdbus-1-dev:amd64 (1.12.20-2) ...
Setting up libpcap0.8-dev:amd64 (1.10.0-2) ...
Setting up libpcap-dev:amd64 (1.10.0-2) ...
Processing triggers for man-db (2.9.4-2) ...
Errors were encountered while processing:
 grub-pc
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

先解決 grup 問題

[tsec@dependentmini:~/honeyd-1.5c]$ sudo DEBIAN_FRONTEND=dialog dpkg --configure grub-pc
Setting up grub-pc (2.06-3~deb11u2) ...
Installing for i386-pc platform.
Installation finished. No error reported.
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
Installation finished. No error reported.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.10.0-18-amd64
Found initrd image: /boot/initrd.img-5.10.0-18-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
done

都勾選後即可

sudo dpkg --configure -a

之後就可成功安裝

sudo apt-get install  libpcap-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libpcap-dev is already the newest version (1.10.0-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

安裝 libdnet-dev

參考 https://linux-packages.com/debian/package/libdnet-dev,執行

sudo apt-get install  libdnet-dev

安裝後還是會提示

configure: error: dnet-config not found

參考 https://command-not-found.com/dnet-config 要再安裝 libdumbnet

sudo apt-get install libdumbnet-dev

安裝 libevent

參考 https://linux-packages.com/debian/package/libevent-dev

sudo apt-get install libevent-dev

安裝 libedit

sudo apt-get install libedit-dev

本體 honeyd 1.5c 安裝

1.5c 為原官方出的最後一個版本

[tsec@dependentmini:~]$ wget http://www.honeyd.org/uploads/honeyd-1.5c.tar.gz && tar -xjf honeyd-1.5c.tar.gz
--2022-09-26 03:47:33--  http://www.honeyd.org/uploads/honeyd-1.5c.tar.gz
Resolving www.honeyd.org (www.honeyd.org)... 207.158.15.70
Connecting to www.honeyd.org (www.honeyd.org)|207.158.15.70|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 915465 (894K) [application/x-gzip]
Saving to: ‘honeyd-1.5c.tar.gz’

honeyd-1.5c.tar.gz                          100%[===========================================================================================>] 894.01K   740KB/s    in 1.2s

2022-09-26 03:47:35 (740 KB/s) - ‘honeyd-1.5c.tar.gz’ saved [915465/915465]

[tsec@dependentmini:~]$ tar -xvf honeyd-1.5c.tar.gz
honeyd-1.5c/
[tsec@dependentmini:~]$ cd honeyd-1.5c/
[tsec@dependentmini:~]$ ./configure

p.s.出現 configure: error: Couldn't figure out how to access libc的話,執行

ln -s /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/libc.so

參考: https://stackoverflow.com/questions/27267110/couldnt-figure-out-how-to-access-libc-on-installing-honeyd

再次執行還是有錯誤

gcc -DHAVE_CONFIG_H -I. -I. -I. -I./compat/libdnet -I./compat -I/usr/include/pcap -I/usr/include     -O2 -Wall -g -DPATH_HONEYDINCLUDE="\"/usr/local/include/honeyd\"" -DPATH_HONEYDDATA="\"/usr/local/share/honeyd\"" -DPATH_HONEYDLIB="\"/usr/local/lib/honeyd\"" -DHONEYD_PLUGINS_DECLARE="" -DHONEYD_PLUGINS="" -DPATH_RRDTOOL="\"\"" -c honeyd.c
In file included from /usr/include/event.h:77,
                 from honeyd.c:73:
tagging.h:89:6: error: expected declaration specifiers or ‘...’ before ‘(’ token
   89 | void encode_int(struct evbuffer *evbuf, uint32_t number);
      |      ^~~~~~~~~~
tagging.h:89:6: error: expected declaration specifiers or ‘...’ before ‘(’ token
   89 | void encode_int(struct evbuffer *evbuf, uint32_t number);
      |      ^~~~~~~~~~
In file included from stats.h:36,
                 from honeyd.c:98:
./compat/sha1.h:23:3: warning: ‘bounded’ attribute directive ignored [-Wattributes]
   23 |   __attribute__((__bounded__(__minbytes__,2,64)));
      |   ^~~~~~~~~~~~~
./compat/sha1.h:23:3: warning: ‘bounded’ attribute directive ignored [-Wattributes]
./compat/sha1.h:26:3: warning: ‘bounded’ attribute directive ignored [-Wattributes]
   26 |   __attribute__((__bounded__(__string__,2,3)));
      |   ^~~~~~~~~~~~~
./compat/sha1.h:28:3: warning: ‘bounded’ attribute directive ignored [-Wattributes]
   28 |   __attribute__((__bounded__(__minbytes__,1,20)));
      |   ^~~~~~~~~~~~~
./compat/sha1.h:30:3: warning: ‘bounded’ attribute directive ignored [-Wattributes]
   30 |   __attribute__((__bounded__(__minbytes__,2,41)));
      |   ^~~~~~~~~~~~~
./compat/sha1.h:32:3: warning: ‘bounded’ attribute directive ignored [-Wattributes]
   32 |   __attribute__((__bounded__(__minbytes__,2,41)));
      |   ^~~~~~~~~~~~~
./compat/sha1.h:35:3: warning: ‘bounded’ attribute directive ignored [-Wattributes]
   35 |   __attribute__((__bounded__(__minbytes__,3,41)));
      |   ^~~~~~~~~~~~~
./compat/sha1.h:35:3: warning: ‘bounded’ attribute directive ignored [-Wattributes]
make[2]: *** [Makefile:650: honeyd.o] Error 1
make[2]: Leaving directory '/home/tsec/honeyd-1.5c'
make[1]: *** [Makefile:1022: all-recursive] Error 1
make[1]: Leaving directory '/home/tsec/honeyd-1.5c'

整個大爆炸呀,參考 https://thereisawaytodothat.wordpress.com/2016/03/10/honeyd-install-error-fixed/ 果斷放棄。

下一篇考慮第三方開發的 1.6 版。


上一篇
Honeypot #6 開源軟體 honeyd
下一篇
Honeypot #8 再慘敗的 honeyd 1.6d 安裝過程
系列文
HONEYPOT×TRICK 100%不純保證33
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言